<?php

class Crud_Db_Table_Column_Enum extends Crud_Db_Table_Column_Abstract
{
	/**
	 * Enum values.
	 * 
	 * @var array
	 */
	protected $_enumValues = array();
	
	/**
	 * Create column.
	 * 
	 * @param Crud_Db_Table_Abstract $table
	 * @param string $name Column name.
	 */
	public function __construct($table, $name)
	{
		parent::__construct($table, $name);
		
		$type = $this->getType();
		preg_match_all("/\'([^\']+)\'/is", $type, $result);
		$this->_enumValues = $result[1];
		$this->_type = 'enum';
	}
	
	/**
	 * Return array with enum values.
	 * 
	 * @return array
	 */
	public function getEnumValues()
	{
		return $this->_enumValues;
	}
}